<template>
  <div>
    <van-cell is-link @click="showPopup">增加</van-cell>
<van-popup v-model:show="show">
  <van-cell-group inset>
  <!-- 输入任意文本 -->
  <van-field v-model="form.id"  label="组织编码" />
  <!-- 请输入组织名称 -->
  <van-field v-model="form.name"  label="组织类型" />
  <!-- 请输入组织类型 -->
  <van-field v-model="form.code"  label="组织缩写" />
  <!-- 请输入组织缩写 -->
  <van-field v-model="form.pid"  label="组织排序" />
  <!-- 输入编码 -->  
</van-cell-group>
<van-button type="primary" @click="add">添加</van-button>
</van-popup>
  </div>
</template>

<script>
import axios from 'axios'
export default {
   data(){
     return{
       show:false,

       form:{
         id:"",
         name:"",
         code:"",
         pid:""
       }
     }      
   },
   methods:{
     showPopup(){
       this.show=true
     },
     add(){
       axios({url:"add",method:"post",data:this.form}).then(res=>{
         console.log(res)
       })
     }
   }
    


}
</script>

<style>

</style>